package test;

import java.util.Scanner;

public class 银行存钱 {
    public static void main(String[] args) {
        //键盘录入
        Scanner sc = new Scanner(System.in);

        System.out.println("请输入您的存款金额");
        int money = sc.nextInt();
        System.out.println("请输入您的存款年限");
        int yearCount = sc.nextInt();
        //定义一个变量 是取出钱的总金额
        double outMoney = 0;

        if (yearCount == 1) {
            outMoney = money + money * 2.25 / 100 * 1;
        } else if (yearCount == 2) {
            outMoney = money + money * 2.7 / 100 * 2;
        } else if (yearCount == 3) {
            outMoney = money + money * 3.25 / 100 * 3;
        } else if (yearCount == 5) {
            outMoney = money + money * 3.6 / 100 * 5;
        } else {
            System.out.println("输入的年限有误");
        }
        System.out.println("您存"+yearCount+"年取走的钱是："+outMoney);
    }
}
